﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Master.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="UI.Admin.Column.Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="stylesheet" href="/Admin/assets/css/jquery-ui-1.10.3.full.min.css" />
    <script src="JsFunction.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

	<h3 class="header smaller lighter blue">导航栏管理&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn btn-info btn-sm" onclick="summit_add_column()"><i class="icon-plus"></i>添加导航栏项</a></h3>
	<div class="row">
		<div class="col-xs-12">
					<div class="widget-box">
						<div class="widget-header widget-header-flat">
							<h4><strong>提示：</strong><small>这是一个可拖拽的列表，列表的排序可以通过拖拽重新定序。</small></h4>
						</div>

						<div class="widget-body">
							<div class="widget-main">

								<div class="row">
                                    <div class="col-sm-8 col-sm-offset-2">      
                                          <div>                                             
						                        <ol class="dd-list">
                                                    <li>
						                            <div class="dd-handle dd2-handle btn-info">
							                            <i class="normal-icon icon-dashboard bigger-130"></i>                                                         					      
						                            </div>
						                            <div class="dd2-content btn-info no-hover">
                                                        控制台                                       
						                            </div>
					                                </li>
                                                </ol>
                                            </div>                
					                        <div class="dd" id="nestable">                                             
						                        <ol class="dd-list FistClass">
                                                  
                                                    <%for(int i=0;i<ColumnList.Count;i++){ %>
                                                    <%if(ColumnList[i].ParentID==0){ %>                          							                    
									                    <li class="dd-item"  data-id="<%=ColumnList[i].ID %>">
										                    <div class="dd-handle">
											                    <%=ColumnList[i].Name %>
											                    <div class="pull-right action-buttons">
												                    <a class="blue" href="javascript:void(0)" onclick="summit_update_column('<%=ColumnList[i].ID %>','<%=ColumnList[i].Name %>','<%=ColumnList[i].ParentID %>','<%=ColumnList[i].ModelID %>','<%=ColumnList[i].ColumnLogo%>','<%=ColumnList[i].Remark %>')">
													                    <i class="icon-pencil bigger-130"></i>
												                    </a>

												                    <a class="red" href="javascript:void(0)" onclick="summit_delete_column(<%=ColumnList[i].ID %>)">
													                    <i class="icon-trash bigger-130"></i>
												                    </a>
											                    </div>
										                    </div>
                                                         <%if(BLL.Find.FindSubColumn(ColumnList[i].ID.ToString()).Count>0){ %>
                                                            <ol class="dd-list">
											                     <%for(int j=0;j<ColumnList.Count;j++){ %>
                                                                    <%if(ColumnList[j].ParentID==ColumnList[i].ID) {%>
																    <li class="dd-item" data-id="<%=ColumnList[j].ID %>">
																	    <div class="dd-handle"><%=ColumnList[j].Name %>
                                                                            <div class="pull-right action-buttons">
												                                <a class="green" href="javascript:void(0)" onclick="summit_update_column('<%=ColumnList[j].ID %>','<%=ColumnList[j].Name %>','<%=ColumnList[j].ParentID %>','<%=ColumnList[j].ModelID %>','<%=ColumnList[j].ColumnLogo %>','<%=ColumnList[j].Remark %>')">
													                                <i class="icon-pencil bigger-130"></i>
												                                </a>

												                                <a class="red" href="javascript:void(0)" onclick="summit_delete_column(<%=ColumnList[j].ID %>)">
													                                <i class="icon-trash bigger-130"></i>
												                                </a>
											                                </div>
																	    </div>
                                                                        <%if(BLL.Find.FindSubColumn(ColumnList[j].ID.ToString()).Count>0){ %>
                                                                        <ol class="dd-list">
											                            <%for(int k=0;k<ColumnList.Count;k++){ %>
                                                                        <%if(ColumnList[k].ParentID==ColumnList[j].ID) {%>
																        <li class="dd-item" data-id="<%=ColumnList[k].ID %>">
																	        <div class="dd-handle"><%=ColumnList[k].Name %>
                                                                                <div class="pull-right action-buttons">
												                                    <a class="green" href="javascript:void(0)" onclick="summit_update_column('<%=ColumnList[k].ID %>','<%=ColumnList[k].Name %>','<%=ColumnList[k].ParentID %>','<%=ColumnList[k].ModelID %>','<%=ColumnList[k].ColumnLogo %>','<%=ColumnList[k].Remark %>')">
													                                    <i class="icon-pencil bigger-130"></i>
												                                    </a>

												                                    <a class="red" href="javascript:void(0)" onclick="summit_delete_column(<%=ColumnList[k].ID %>)">
													                                    <i class="icon-trash bigger-130"></i>
												                                    </a>
											                                    </div>
																	        </div>                                                                  
																        </li>
                                                                        <%} %>
                                                                        <%} %>
										                                </ol>
                                                                    <%} %>                                                                  
																    </li>
                                                                 <%} %>
                                                                 <%} %>
										                    </ol>
                                                        <%} %>
									                    </li>
                                                    <%} %>
                                                    <%} %>                                                								                       
						                        </ol>
					                        </div>
				                        </div>								
								</div>

								<hr />

								<div class="row">
	                                <div class="col-sm-8 col-lg-offset-2 center">
					                <button class="btn btn-primary" type="button" onclick="summit_sort_column()">
						                <i class="icon-ok bigger-110"></i>
						                修改排序
					                </button>

					                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
					                <button class="btn" type="reset" onclick="summit_clear()">
						                <i class="icon-undo bigger-110"></i>
						                重置
					                </button>                        											
				                     </div> 							
								</div>

							</div>
						</div>
					</div>
	             			                                
		</div><!-- /.col -->
	</div><!-- /.row -->

    <div id="dialog-message" class="hide">	
		    <label id="form_start">栏目名称：</label>
		    <input type="text" placeholder="例：新闻中心" id="Name"/>
            <br /><br />
            
		    <label>父级栏目：</label>
		    <select  id="form-field-select-1">
                <option value="0">导航栏&nbsp;&nbsp;</option>
          
                  <%for(int i=0;i<ColumnList.Count;i++){ %>
                   <option value="<%=ColumnList[i].ID %>"><%=ColumnList[i].Name %>&nbsp;&nbsp;</option>
                  <%} %>
            
            </select>
            <br /><br />
            <label>数据模型：</label>
		      <select  id="form-field-select-2">
                <option value="">&nbsp;</option>
          
                  <%for(int i=0;i<ModelList.Count;i++){ %>
                   <option value="<%=ModelList[i].ID %>"><%=ModelList[i].Name %>&nbsp;&nbsp;</option>
                  <%} %>
              
            </select>
             <br /><br />	
            <label>栏目图标：</label>
	            <select id="ColumnLogo" class="width-45">
                    <option value="comments" >评论</option>
                    <option value="envelope" >邮件</option>
                    <option value="calendar" >日历</option>
                    <option value="download-alt" >下载</option>
                    <option value="cloud-upload" >上传</option>
                    <option value="folder-open" >文件</option>
                    <option disabled="disabled"></option>                          
                    <option value="edit" >文章</option>
                    <option value="film" >电影</option>
                    <option value="picture" >照片</option>              
                    <option value="phone" >电话</option>
                    <option value="file-alt" >信息</option>
                    <option value="desktop">电脑</option>
                    <option disabled="disabled"></option>                 
                    <option value="wrench" >工具</option>
                    <option value="search">搜索</option>
                    <option value="tags" >标签</option>
                    <option value="tasks" >任务</option>
                    <option value="building">建筑</option>
                    <option value="shopping-cart">购物</option>
                     <option disabled="disabled"></option>                 
                    <option value="book" >书本</option>
                    <option value="camera">相机</option>
                    <option value="clock-o" >时钟</option>
                    <option value="cogd" >设置</option>
                    <option value="cutlery">餐具</option>
                    <option value="fire">火苗</option>
                     <option disabled="disabled"></option>                 
                    <option value="flag" >旗子</option>
                    <option value="flask">瓶子</option>
                    <option value="gamepad" >游戏</option>
                    <option value="gift" >礼物</option>
                    <option value="group">团队</option>
                    <option value="glass">奖杯</option>
                       <option disabled="disabled"></option>                 
                    <option value="globe" >地球</option>
                    <option value="home">屋子</option>
                    <option value="keyboard-o" >键盘</option>
                    <option value="magic" >魔术</option>
                    <option value="male">小人</option>
                    <option value="music">音乐</option>
                      <option disabled="disabled"></option>                 
                    <option value="pencil" >铅笔</option>
                    <option value="puzzle-piece">拼图</option>
                    <option value="suitcase" >药箱</option>
                    <option value="umbrella" >雨伞</option>
                    <option value="wheelchair">轮椅</option>
                    <option value="volume-up">喇叭</option>
                </select>
                <br /><br />	   
            <label for="form-field-8">备注</label>
			<textarea class="form-control" id="Remark"></textarea>  
	</div><!-- #dialog-message -->
               
					                      
	<div id="dialog-confirm" class="hide">
		<div class="alert alert-info bigger-110">
				删除操作执行后不可恢复
		</div>

		<div class="space-6"></div>

		<p class="bigger-110 bolder center grey">
			<i class="icon-hand-right blue bigger-120"></i>
			Are you sure?
		</p>
	</div>
    
    <div id="dialog-success" class="hide">				    
		<div class="space-16"></div>
		<p class="bigger-110  center ">
			<i class="icon-hand-right blue bigger-120"></i>
			根据列表的位置重新排序？
		</p>										
	</div>			                       					
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">   
    <script src="/Admin/assets/js/jquery-ui-1.10.3.full.min.js"></script>
	<script src="/Admin/assets/js/jquery.ui.touch-punch.min.js"></script>
    <script src="/Admin/assets/js/jquery.nestable.min.js"></script>

    		
    <script type="text/javascript">
    	jQuery(function ($) {
    	    $("#menu-li").addClass("active");
    	 
    		$('.dd').nestable();

    		$('.dd-handle a').on('mousedown', function (e) {
    		    e.stopPropagation();
    		});

    		$('[data-rel="tooltip"]').tooltip();
    	});

    	$.widget("ui.dialog", $.extend({}, $.ui.dialog.prototype, {
    	    _title: function (title) {
    	        var $title = this.options.title || '&nbsp;'
    	        if (("title_html" in this.options) && this.options.title_html == true)
    	            title.html($title);
    	        else title.text($title);
    	    }
    	}));
		</script>
</asp:Content>
